home *** CD-ROM | disk | FTP | other *** search
/ Aminet 52 / Aminet 52 (2002)(GTI - Schatztruhe)[!][Dec 2002].iso / Aminet / game / patch / WHDIGamesU-Z.lzh / WackyRaces.lha / WackyRacesHD / Install next >
Text File  |  2002-01-05  |  4KB  |  216 lines

  1. ;****************************
  2.  
  3. (set #readme-file "ReadMe")        ;name of readme file
  4. (set #docs-file "Instructions")        ;name of docs file
  5. (set #highs-file "highs")        ;name of high scores file
  6. (set #cleanup "")            ;files to delete after install
  7. (set #last-file "Disk.2")        ;last file the imager should create
  8.  
  9. ;****************************
  10. ;----------------------------
  11. ; checks if given program is installed, if not abort install
  12. ; #program - to check
  13.  
  14. (procedure P_ChkRun
  15.   (if
  16.     (= 0 (run ("cd SYS:\nWhich %s" #program)))
  17.     ("")
  18.     (abort
  19.       (cat
  20.     "You must install \"" #program "\" first!\n"
  21.     "It must be accessible via the path.\n"
  22.     "You can find it in the WHDLoad package."
  23.       )
  24.     )
  25.   )
  26. )
  27.  
  28. ;****************************
  29.  
  30. (if
  31.   (exists #readme-file)
  32.   (if
  33.     (= 0 (run ("SYS:Utilities/Multiview %s" #readme-file)))
  34.     ("")
  35.     (run ("SYS:Utilities/More %s" #readme-file))
  36.   )
  37. )
  38.  
  39. (set #program "WHDLoad")
  40. (P_ChkRun)
  41.  
  42. (set #program "RawDIC")
  43. (P_ChkRun)
  44.  
  45. (if
  46.   (= @user-level 2)
  47.   (
  48.     (set #CI_drive
  49.       (askchoice
  50.     (prompt "Select source drive for diskimages")
  51.     (default 0)
  52.     (choices "DF0:" "DF1:" "DF2:" "DF3:")
  53.     (help @askchoice-help)
  54.       )
  55.     )
  56.     (select #CI_drive
  57.       (set #CI_drive "DF0:")
  58.       (set #CI_drive "DF1:")
  59.       (set #CI_drive "DF2:")
  60.       (set #CI_drive "DF3:")
  61.     )
  62.     (set #ignore " IGNOREERRORS")
  63.   )
  64.   (set #CI_drive "DF0:")
  65.   (set #ignore "")
  66. )
  67.  
  68. (if
  69.   (getenv "WHDLInstPath")
  70.   (set @default-dest (getenv "WHDLInstPath"))
  71. )
  72. (set #dest
  73.   (askdir
  74.     (prompt ("Where should \"%s\" be installed?\nA drawer \"%s\" will be automatically created." @app-name @app-name))
  75.     (help @askdir-help)
  76.     (default @default-dest)
  77.     (disk)
  78.   )
  79. )
  80. (run ("setenv WHDLInstPath \"%s\"\ncopy ENV:WHDLInstPath ENVARC:" @default-dest))
  81. (set #dest (tackon #dest @app-name))
  82. (if
  83.   (exists #dest)
  84.   (
  85.     (set #choice
  86.       (askbool
  87.         (prompt ("\nDirectory \"%s\" already exists.\n Should it be deleted?" #dest))
  88.         (default 1)
  89.         (choices "Delete" "Skip")
  90.         (help @askbool-help)
  91.       )
  92.     )
  93.     (if
  94.       (= #choice 1)
  95.       (run ("Delete \"%s\" \"%s.info\" All" #dest #dest))
  96.     )
  97.   )
  98. )
  99. (makedir #dest
  100.   (help @makedir-help)
  101.   (infos)
  102. )
  103.  
  104. ;----------------------------
  105.  
  106. (if
  107.   (exists ("%s.newicon" @app-name))
  108.   (set #icon
  109.     (askchoice
  110.       (prompt "\nWhich icon would you like to install?\n")
  111.       (default 0)
  112.       (choices "RomIcon" "NewIcon" "GlowIcon" "Exotic NewIcon (box scan)" "Exotic GlowIcon (box scan)")
  113.       (help @askchoice-help)
  114.     )
  115.   )
  116.   (set #icon 0)
  117. )
  118. (select #icon
  119.   (set #icon ("%s.inf" @app-name))
  120.   (set #icon ("%s.newicon" @app-name))
  121.   (set #icon ("%s.glowicon" @app-name))
  122.   (set #icon ("%s.newexot" @app-name))
  123.   (set #icon ("%s.glowexot" @app-name))
  124. )
  125. (copyfiles
  126.   (help @copyfiles-help)
  127.   (source #icon)
  128.   (newname ("%s.info" @app-name))
  129.   (dest #dest)
  130. )
  131. (tooltype
  132.   (dest (tackon #dest @app-name))
  133.   (settooltype "Slave" ("%s.Slave" @app-name))
  134.   (setdefaulttool "WHDLoad")
  135.   (setstack 10240)
  136.   (noposition)
  137. )
  138. (copyfiles
  139.   (help @copyfiles-help)
  140.   (source ("%s.Slave" @app-name ))
  141.   (dest #dest)
  142. )
  143. (if
  144.   (exists #readme-file)
  145.   (copyfiles
  146.     (help @copyfiles-help)
  147.     (source #readme-file)
  148.     (dest #dest)
  149.   )
  150. )
  151. (if
  152.   (exists ("%s.info" #readme-file))
  153.   (
  154.     (copyfiles
  155.       (help @copyfiles-help)
  156.       (source ("%s.info" #readme-file))
  157.       (dest #dest)
  158.     )
  159.     (tooltype
  160.       (dest (tackon #dest #readme-file))
  161.       (noposition)
  162.     )
  163.   )
  164. )
  165. (if
  166.   (exists #docs-file)
  167.   (copyfiles
  168.     (help @copyfiles-help)
  169.     (source #docs-file)
  170.     (dest #dest)
  171.   )
  172. )
  173. (if
  174.   (exists ("%s.info" #docs-file))
  175.   (
  176.     (copyfiles
  177.       (help @copyfiles-help)
  178.       (source ("%s.info" #docs-file))
  179.       (dest #dest)
  180.     )
  181.     (tooltype
  182.       (dest (tackon #dest #docs-file))
  183.       (noposition)
  184.     )
  185.   )
  186. )
  187. (if
  188.   (exists #highs-file)
  189.   (copyfiles
  190.     (help @copyfiles-help)
  191.     (source #highs-file)
  192.     (dest #dest)
  193.   )
  194. )
  195.  
  196. (copyfiles
  197.   (help @copyfiles-help)
  198.   (source ("%s.islave" @app-name))
  199.   (dest #dest)
  200. )
  201.  
  202. (working)
  203. (run ("CD \"%s\"\nRawDIC SLAVE=%s.islave SOURCE=%s%s\nDelete %s.islave" #dest @app-name #CI_drive #ignore @app-name))
  204.  
  205. (if
  206.   (exists (tackon #dest #last-file))
  207.   ("")
  208.   (abort "Diskimaging was not successful!\nRawDIC was unable to create all needed files!")
  209. )
  210.  
  211. ;----------------------------
  212.  
  213. (run ("Delete %s ALL QUIET FORCE" #cleanup))    ;delete temporary files
  214.  
  215. (exit)
  216.